<?php

namespace App\Backend\Http\Controllers;

use App\Invitation;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Controller;

class InvitedController extends Controller
{
    /**
     * Display a listing of the resource.
     * @return Response
     */
    public function index()
    {
        !empty(request('sort')) ? $order = request('sort') : $order = 'created_at';
        $data['invited'] = Invitation::orderBy($order,'desc')->paginate(20);
        $data['sort'] = request('sort');
        return view('backend::user.invitation',$data);
    }

}
